package com.junlaninfo;

import com.junlaninfo.entity.UserEntity;

/**
 * Created by 辉 on 2020/12/7.
 * 定义对象的时候要重写equals方法和hashcode
 */
public class Test2 {
    public static void main(String[] args) {
        UserEntity user1 = new UserEntity("xuexionghui", 26);
        UserEntity user2 = new UserEntity("xuexionghui", 26);
        System.out.println(user1.hashCode());
        System.out.println(user2.hashCode());
        System.out.println(user1.equals(user2));

    }
}
